 public class MaxChildArray
 {
     public static void main(String[] args){
		int [] num=new int[args.length];
		for(int i=0;i<num.length;i++){
			num[i]=Integer.parseInt(args[i]);
		}
         int max_end_here = num[0];
		 int max_so_far = num[0];
		 for(int i = 1; i < num.length; i++){
			 max_end_here = max(num[i],max_end_here+num[i]);
			 max_so_far = max(max_so_far,max_end_here);
		 }
		 System.out.println(max_so_far);
     }
	 public static int max(int num1,int num2){
		 return num1>num2?num1:num2;
	 }
 }